<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>登录页</title>
  <link rel="stylesheet" href="css/weui.css"/>
  <link rel="stylesheet" href="css/weuix.css"/>
  <link rel="stylesheet" href="css/style.css">

  <script src="js/common/zepto.min.js"></script>
  <script src="js/common/zepto.weui.js"></script>
</head>
<body ontouchstart>

    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label">手机号</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" placeholder="请输入手机号" type="tel">
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label">密码</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" placeholder="请输入密码" type="password">
            </div>
        </div>
        <div class="weui-cell weui-cell_vcode">
            <div class="weui-cell__hd">
                <label class="weui-label">验证码</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" placeholder="验证码" type="number">
            </div>
            <div class="weui-cell__ft">
                <button  class="weui-vcode-btn" onclick="settime(this)">获取验证码</button>
            </div>
        </div>
    </div>

    <div class="weui-btn-area">
        <a class="weui-btn weui-btn_primary" href="index.html" id="btn">登录</a>
    </div>

    <script>
        var countdown=60;

        function settime(obj) {

            var code = $(obj);
            if (countdown == 0) {
                code.removeAttr('disabled');
                code.text("获取验证码");
                countdown =60;
                return;
            } else {
                code.text("重新发送(" + countdown + ")");
                code.attr('disabled',true);
                countdown--;
            }
            setTimeout(function() { settime(obj) }, 1000);
        }
    </script>

</body>
</html>